@GENERIC_TEXTEDITOR_BORDER_WIDTH: @GENERIC_BASE_BORDER_WIDTH;
@GENERIC_TEXTEDITOR_INPUT_PADDING: @GENERIC_BASE_INLINE_BORDEREDWIDGET_PADDING;

@GENERIC_TEXTEDITOR_ICON_CONTAINER_SIZE: @GENERIC_BASE_INLINE_BORDEREDWIDGET_INNER_SIZE;
@GENERIC_TEXTEDITOR_ICON_SIZE: @GENERIC_BASE_ICON_SIZE;

@GENERIC_TEXTEDITOR_CLEAR_ICON_SIZE: @GENERIC_TEXTEDITOR_ICON_SIZE + @GENERIC_TEXTEDITOR_CLEAR_ICON_OVERSIZE;

@GENERIC_TEXTEDITOR_INVALID_BADGE_SIZE: @GENERIC_INVALID_BADGE_SIZE + 2 * @GENERIC_INVALID_BADGE_HORIZONTAL_PADDING;

.dx-size-default() {
    @GENERIC_TEXTEDITOR_CLEAR_ICON_OVERSIZE: 2px;
}

.dx-size-compact() {
    @GENERIC_TEXTEDITOR_CLEAR_ICON_OVERSIZE: 1px;
}

.dx-texteditor-icon() {
    position: absolute;
    top: 50%;
    margin-top: -@GENERIC_TEXTEDITOR_ICON_CONTAINER_SIZE/2;
    .dx-icon-sizing(@GENERIC_TEXTEDITOR_ICON_SIZE, @GENERIC_TEXTEDITOR_ICON_CONTAINER_SIZE);
}

.validation-icon-position(@padding: 0) {
    &.dx-invalid {
        .dx-texteditor-input {
            padding-right: @padding + @GENERIC_TEXTEDITOR_INVALID_BADGE_SIZE;
        }

        &.dx-rtl .dx-texteditor-input {
            padding: @GENERIC_TEXTEDITOR_INPUT_PADDING;
            padding-left: @padding + @GENERIC_TEXTEDITOR_INVALID_BADGE_SIZE;
        }

        .dx-texteditor-container {
            &:after {
                right: @GENERIC_INVALID_BADGE_HALFHORIZONTAL_PADDING + @padding;

                .dx-rtl & {
                    left: @GENERIC_INVALID_BADGE_HALFHORIZONTAL_PADDING + @padding;
                    right: auto;
                }
            }
        }
    }
}

.dx-texteditor {
    background: @texteditor-bg;
    border: @GENERIC_TEXTEDITOR_BORDER_WIDTH solid @texteditor-border-color;
    border-radius: @texteditor-border-radius;

    &.dx-state-readonly {
        border-color: @texteditor-readonly-border-color;
    }

    &.dx-state-hover {
        border-color: @texteditor-hover-border-color;
    }

    &.dx-state-focused, &.dx-state-active {
        border-color: @texteditor-focused-border-color;
        .box-shadow(none);
    }

    .validation-icon-position();

    &.dx-show-clear-button:not(.dx-texteditor-empty) {
        .validation-icon-position(@GENERIC_TEXTEDITOR_ICON_CONTAINER_SIZE);
    }
}

.dx-show-clear-button {
    .dx-texteditor-input {
        padding-right: @GENERIC_TEXTEDITOR_ICON_CONTAINER_SIZE;
        .dx-rtl &,
        .dx-rtl& {
            padding: @GENERIC_TEXTEDITOR_INPUT_PADDING;
            padding-left: @GENERIC_TEXTEDITOR_ICON_CONTAINER_SIZE;
        }
    }

    .dx-clear-button-area {
        width: @GENERIC_TEXTEDITOR_ICON_CONTAINER_SIZE;
        right: 0;
    }

    .dx-icon-clear {
        color: @texteditor-button-clear-icon-color;
        .dx-texteditor-icon();
        .dx-icon-sizing(@GENERIC_TEXTEDITOR_CLEAR_ICON_SIZE - @GENERIC_TEXTEDITOR_CLEAR_ICON_OVERSIZE, @GENERIC_TEXTEDITOR_ICON_CONTAINER_SIZE);
    }
}

/*B231111*/
.dx-placeholder {
    color: @texteditor-placeholder-color;

    &:before {
        padding: @GENERIC_TEXTEDITOR_INPUT_PADDING;
    }
}

.dx-texteditor-input {
    margin: 0;
    padding: @GENERIC_TEXTEDITOR_INPUT_PADDING;
    background: @texteditor-bg;
    color: @texteditor-color;
    font-size: 1em;
    border-radius: @texteditor-input-border-radius;
    min-height: round(@GENERIC_BASE_LINE_HEIGHT * @GENERIC_BASE_FONT_SIZE) + @GENERIC_BASE_INLINE_BORDEREDWIDGET_TOP_PADDING + @GENERIC_BASE_INLINE_BORDEREDWIDGET_BOTTOM_PADDING
}

.dx-invalid.dx-texteditor {
    border-color: @texteditor-invalid-faded-border-color;

    &.dx-state-focused {
        border-color: @texteditor-invalid-focused-border-color;
    }

    .dx-texteditor-container {
        &:after {
            .dx-invalid-generic-badge();
        }
    }
}

.dx-rtl {
    .dx-placeholder,
    .dx-placeholder:before {
        right: 0;
        left: auto;
    }
}
